package com.mmd.user.model.enums;

public enum PayEnums {

    Wechat(0,"1"),
    Alipay(1,"2");
    private Integer type;
    private String name;

    PayEnums(Integer type, String name) {
        this.type = type;
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    // 普通方法
    public static String getName(int index) {
        for (PayEnums c : PayEnums.values()) {
            if (c.getType() == index) {
                return c.name;
            }
        }
        return null;
    }
}
